#include <iostream>
#include <unistd.h>
#include <vector>
#include "thread.hpp"
using namespace std;
void Print();
int main()
{
    vector<Thread> threads;
    for (int i = 0; i < 5; i++)
    {
        threads.push_back(Thread(Print));
    }
    for (auto &t : threads)
    {
        t.Run();
    }
    for (auto &t : threads)
    {
        t.Join();
    }
    return 0;
}

void Print()
{
    while (true)
    {
        cout << "i am a new thread,name:" << pthread_self() << endl;
        sleep(1);
    }
}
// int main()
// {
//     Thread t(Print);

//     t.Run();
//     cout << "name:" << t.Name() << endl;
//     cout << "is running:" << t.IsRunning() << endl;
//     cout << "time:" << t.Timestamp() << endl;
//     t.Join();
//     return 0;
// }